<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <style>
        .div {
            background-color: #ff0000;
            height: 200px;
        }

        /* 屏幕小于768px之后，执行以下样式 */
        @media screen and (max-width: 768px) {
            .div {
                background-color: #00ff00;
            }
        }
    </style>
</head>
<body>
    <div class="div"></div>
</body>
</html>